/* Copyright 2016 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

:host > ::content > * {
  margin: 0;
  padding: 0;
}

dialog {
  background-color: transparent;
  border: none;
  font-size: 100%;
  height: 100%;
  margin: 0;
  max-height: initial;
  max-width: initial;
  opacity: 0;
  outline: none;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

dialog[open] {
  opacity: 1;
  transition: opacity 200ms;
}

dialog:focus {
  outline: none;
}

dialog::backdrop {
  background-color: #000;
  opacity: 0.6;
}

dialog#delete-confirm-dialog::backdrop {
  background-color: transparent;
}

.thumbnail {
  flex: none;
  height: 100%;
  width: 100%;
}

#video-poster {
  max-height: 100%;
  max-width: 100%;
}

#audio-artwork {
  height: 100%;
  margin: 0 auto;
  width: 100%;
}

#mainPanel {
  background-color: transparent;
  bottom: 0;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 48px;
  width: 100%;
}

:host([files-ng]) #mainPanel {
  top: 56px;
}

#contentPanel {
  background-color: transparent;
  display: flex;
  height: 100%;
  justify-content: center;
  position: relative;
}

#contentPanel[metadata-box-active] {
  margin-right: 320px;
}

:host-context(html[dir='rtl']) #contentPanel[metadata-box-active] {
  margin-left: 320px;
  margin-right: auto;
}

#innerContentPanel {
  background-color: transparent;
  color: white;
  display: flex;
  flex-direction: column;
  height: calc(100% - 64px);
  justify-content: center;
  outline: none;
  padding: 32px;
  position: relative;
  text-align: center;
  width: 100%;
}

#innerContentPanel[type='audio'],
#innerContentPanel[type='image'],
#innerContentPanel[type='video'] {
  align-self: center;
}

.content {
  height: 100%;
  width: 100%;
}

.text-content {
  background-color: white;
}

#toolbar {
  align-items: center;
  background-color: rgb(40, 42, 45);
  color: white;
  display: flex;
  font-size: 108%;
  height: 48px;
  margin: 0;
  opacity: 0.9;
  padding: 0;
  z-index: 1;
}

:host([files-ng]) #toolbar {
  color: var(--google-grey-200);
  font-family: 'Roboto Medium';
  font-size: 14px;
  height: 56px;
  opacity: 1;
}

#file-path {
  flex: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

:host([files-ng]) #file-path {
  margin-inline-start: 8px;
}

.buttons-group {
  display: flex;
}

:host(:not([files-ng])) cr-button,
:host(:not([files-ng])) files-icon-button {
  --ink-color: currentColor;
  border: none;
  border-radius: 2px;
  color: currentColor;
  height: 32px;
  margin: 0 8px;
  min-width: 32px;
  padding: 0;
  text-transform: uppercase;
}

:host([files-ng]) cr-button {
  --hover-bg-color: rgba(255, 255, 255, 4%);
  --ink-color: rgba(255, 255, 255, 88%);
  --text-color: currentColor;
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: none;
  box-sizing: border-box;
  height: 36px;
  margin: 0 6px;
  min-width: 36px;
  padding: calc(6px - 2px);
  width: 36px;
}

:host-context(html.pointer-active.files-ng) cr-button:not(:active):hover {
  --hover-bg-color: none;
  cursor: unset;
}

:host([files-ng]) cr-button::after {
  content: '';
  height: 48px;
  position: absolute;
  width: 48px;
}

:host([files-ng]) #back-button > .icon,
:host([files-ng]) #open-button > .icon,
:host([files-ng]) #delete-button > .icon,
:host([files-ng]) #info-button > .icon {
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  background-color: currentColor;
  background-image: none;
  height: 36px;
  width: 36px;
}

iron-icon {
  height: 16px;
  width: 16px;
}

:host([files-ng]) #back-button > iron-icon {
  display: none;
}

:host(:not([files-ng])) #back-button > .icon {
  display: none;
}

:host([files-ng]) #back-button > .icon {
  -webkit-mask-image: url(../images/files/ui/back.svg);
}

:host([files-ng]) #open-button > .icon {
  -webkit-mask-image: url(../images/files/ui/external_link.svg);
}

#delete-button > .icon {
  -webkit-mask-image: url(../images/files/ui/delete.svg);
  background-color: currentColor;
  height: 16px;
  width: 16px;
}

:host([files-ng]) #delete-button > .icon {
  -webkit-mask-image: url(../images/files/ui/delete_ng.svg);
}

:host(:not([files-ng])) #info-button {
  display: none;
}

#metadata-button {
  --files-toggle-ripple-bg-color: white;
  --files-toggle-ripple-activated-opacity: 0.3;
}

:host([files-ng]) #metadata-button {
  display: none;
}

:host([files-ng]) #info-button[aria-pressed=true] {
  background-color: rgba(255, 255, 255, 12%);
}

:host([files-ng]) #info-button > .icon {
  -webkit-mask-image: url(../images/files/ui/info.svg);
}

:host(:not([files-ng])) cr-button:focus:not(:active) {
  box-shadow: 0 0 0 1px rgba(66, 133, 244, 50%);
  font-weight: bold;
}

:host-context(html.focus-outline-visible.files-ng) cr-button:not(:active):focus {
  border: 2px solid var(--google-blue-300);
}

#metadata-box {
  background-color: rgba(20, 22, 24, 80%);
  bottom: 0;
  height: 100%;
  margin: 0;
  opacity: 0.8;
  overflow-y: auto;
  position: absolute;
  right: 0;
}

:host([files-ng]) #metadata-box {
  background-color: var(--google-grey-900);
  opacity: 1;
}

:host-context(html[dir='rtl']) #metadata-box {
  left: 0;
  right: auto;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background-clip: content-box;
  background-color: rgb(118, 118, 121);
  border: 2.5px solid transparent;
  width: 5px;
}

[hidden] {
  display: none;
}

.no-preview {
  margin-top: 16px;
}

@media only screen and (max-width: 720px) {
  #contentPanel[metadata-box-active] #innerContentPanel {
    padding-left: 4px;
    padding-right: 4px;
  }
  #contentPanel[metadata-box-active] {
    margin-right: 250px;
  }
}

/* Large generic thumbnails, used when a file does not have a thumbnail. */
[generic-thumbnail] {
  background: -webkit-image-set(
      url(../images/files/ui/quick_view/filetype_generic.png) 1x,
      url(../images/files/ui/quick_view/2x/filetype_generic.png) 2x)
    center
    no-repeat;
  height: 88px;
}

[generic-thumbnail='.folder'] {
  background-image: -webkit-image-set(
      url(../images/files/ui/quick_view/filetype_folder.png) 1x,
      url(../images/files/ui/quick_view/2x/filetype_folder.png) 2x);
  height: 72px;
}

[generic-thumbnail='audio'] {
  background-image: -webkit-image-set(
      url(../images/files/ui/quick_view/filetype_audio.png) 1x,
      url(../images/files/ui/quick_view/2x/filetype_audio.png) 2x);
}

[generic-thumbnail='image'] {
  background-image: -webkit-image-set(
      url(../images/files/ui/quick_view/filetype_image.png) 1x,
      url(../images/files/ui/quick_view/2x/filetype_image.png) 2x);
}

[generic-thumbnail='video'] {
  background-image: -webkit-image-set(
      url(../images/files/ui/quick_view/filetype_video.png) 1x,
      url(../images/files/ui/quick_view/2x/filetype_video.png) 2x);
  height: 72px;
}
